﻿<navigation:Page 
           x:Class="Showroom.Views.Virtualization"
           xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
           xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
           xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
           xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    xmlns:fl="clr-namespace:SStuff.FlowControls;assembly=SStuff.FlowControls"
    xmlns:vm="clr-namespace:Showroom.ViewModels"
           mc:Ignorable="d"
           xmlns:navigation="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls.Navigation"
           d:DesignWidth="640" d:DesignHeight="480"
           Title="FlowLayouts - Virtualization">
    <navigation:Page.DataContext>
        <vm:VirtualizationSampleData />
    </navigation:Page.DataContext>
    <navigation:Page.Resources>
        <DataTemplate x:Key="itemTemplate">
            <ContentControl Width="200" Height="150" 
                                        HorizontalContentAlignment="Center"
                                        VerticalContentAlignment="Center"
                                        Content="{Binding}" />
        </DataTemplate>
    </navigation:Page.Resources>
  <Grid x:Name="LayoutRoot" >
        <Grid.RowDefinitions>
            <RowDefinition Height=".5*" />
            <RowDefinition Height=".5*" />
        </Grid.RowDefinitions>
            <TextBlock TextWrapping="Wrap" Text="The following FlowItemsControl2D and FlowItemsControl3D are bound to a collection of 20000 items and perform well thanks to their virtualization logic." Style="{StaticResource ContentTextStyle}" />
        <fl:FlowItemsControl2D ItemsSource="{Binding Items}" ItemTemplate="{StaticResource itemTemplate}" />
      <fl:FlowItemsControl3D Grid.Row="1" ItemsSource="{Binding Items}" ItemTemplate="{StaticResource itemTemplate}" />
    </Grid>
</navigation:Page>
